<template>
	<view class="content">
<!-- 		<view class="sb">
			<image class="image_11X1" src="/static/国徽.webp"></image>
		</view>
		
		<text class="text_148X1">延边朝鲜族自治州委政法委</text> -->
<!-- 		<view class="zt">
			<view class="jb">涉黑涉恶线索举报</view>
			<view class="ts">(注意:标有 * 的必须填写)</view>	
		</view> -->
		
		<view class="person">
			<text class="bt">举报人信息</text>
		</view>
		<view class="border">
			<view style="width: 100%;margin-left: 5%;margin-top: 1%;margin-bottom: 5%;">
				<view class="title"style="margin-right: 10px;margin-top:3%;">姓名
					<text style="color: red;margin-left: 1%;">*</text>
				</view>
				<view type="text" class="view-field"  >{{report.reportName}}</view>
				<view class="title"style="margin-right: 10px;margin-top:3%;">身份证号
					<text style="color: red;margin-left: 1%;">*</text>
				</view>
				<view type="number" maxlength="18"  class="view-field"  >{{report.reportIdentityCard}}</view>
				<view class="title"style="margin-right: 10px;margin-top:3%;">居住地
					<text style="color: red;margin-left: 1%;">*</text>
				</view>
				<view  type="text" class="view-field" >{{report.reportAddress}}</view>
				<view class="title"style="margin-right: 10px;margin-top:3%;">联系方式
					<text style="color: red;margin-left: 1%;">*</text>
				</view>
				<view  type="text" class="view-field" >{{report.reportTel}}</view>
			</view>
		</view>
		<view class="person">
			<text class="bt">被举报人(单位)信息</text>
		</view>
		<view class="border">
			<view style="width: 100%;margin-left: 5%;margin-top: 1%;margin-bottom: 5%;">
				<view class="title"style="margin-right: 10px;margin-top:3%;">被举报人
					<text style="color: red;margin-left: 1%;">*</text>
				</view>
				<view  type="text" class="view-field" >{{report.beReportedName}}</view>
				<view class="title"style="margin-right: 10px;margin-top:3%;">单位
					<text style="color: red;margin-left: 1%;">*</text>
				</view>
				<view  type="text" class="view-field"  >{{report.beReportedUnit}}</view>
				<view class="title"style="margin-right: 10px;margin-top:3%;">职务
					<text style="color: red;margin-left: 1%;">*</text>
				</view>
				<view  type="text" class="view-field" >{{report.beReportedOffice}}</view>
				<view class="title"style="margin-right: 10px;margin-top:3%;">级别
					<text style="color: red;margin-left: 1%;">*</text>
				</view>
				<view  type="text" class="view-field">{{report.beReportedLevel}}</view>
			</view>
		</view>
		<view class="person">
			<text class="bt">举报正文</text>
		</view>
		<view class="border">
			<view style="width: 100%;margin-left: 5%;margin-top: 1%;margin-bottom: 5%;">
				<view class="title"style="margin-right: 10px;margin-top:3%;">标题
					<text style="color: red;margin-left: 1%;">*</text>
				</view>
				<view  type="text" class="view-field"  >{{report.title}}</view>
				<view class="title"style="margin-right: 10px;margin-top:3%;">问题类别
					<text style="color: red;margin-left: 1%;">*</text>
					
				</view>
				   <view>
						<view type="text" class="view-field" >{{leib.substring(0,16)+'...'}}</view>
				   </view>
				<view class="title"style="margin-right: 10px;margin-top:3%;">具体问题类别
					<view style="width: 93%;">{{leib}}</view>
				</view>
				<view class="title"style="margin-right: 10px;margin-top:3%;">主要问题
					<text style="color: red;margin-left: 1%;">*</text>
				</view>
				<textarea  class="zywt">{{report.content}}</textarea>
				<view style="justify-content: center; align-items: center;width:90%;">
					<view class="sc" >已上传附件</view>
					<view class="item" v-for="(item,index) in photographPics" :key="index">
						<view class="" >{{item.fileName}}</view>
					</view>
				</view>
				<!-- <view style="justify-content: center; align-items: center;">
					<button class="sc" @click="shfj()">上传附件</button>
				</view> -->
			<!-- <view class="text	1">
					<view>
						温馨提示：最多可同时上传4个文件，每个文件只允许上传5M大小。附件仅限于文件名 
					</view>
					<view >
						后缀为.jpg、.png、.gif、.jpeg、,tiff、.svg的文件，禁止exe、bat等格式文件上传！
					</view>
				</view> -->
		
			</view>
		</view>
		<!-- <view class="footer">
			<button class="button1" @click="nmjb()">实名举报</button>
		</view> -->
	</view>
</template>

<script>
	import * as dictData from '@/api/dictData/index';
	import { baseUrl, baseApi } from '@/config';
	import FileApi from '@/api/infra/file.js';
	import idCardNumberVerify from "@/store/idCardNumber/index";
	import * as ReportingApi from '@/api/reporting/index';
	export default {
		onLoad(options) {
			console.log(options)
			this.queryParams.dictType=options.category
			// 在这里处理参数  
			this.getInfo(options.id)
			this.getfileName(options.id)
			// this.cxlb(options)
			
		},
		data() {
			return {
				items:[],
				leib:'请选择',
				photographPics:[],
				tempFilePaths: [],
				report:{
					isAnonymity:'',
					userId:'',
					reportName:'',
					reportIdentityCard:'',
					reportAddress:'',
					reportTel:'',
					beReportedName:'',
					beReportedUnit:'',
					beReportedOffice:'',
					beReportedLevel:'',
					title:'',
					category:'',
					categoryDetail:'',
					content:'',
					fileId:'',
					clueSituation:'',
					illustrate:'',
					remark:'',
					// 用于存储选择的图片路径
					imagePaths: [],
					reportingFiles:[]
					
				},
				queryParams:{
					pageNo: 1,
					pageSize: 20,
					dictType:'',
					value:'',
				}
			
			}
			
		},
		methods: {
			
			 handleChange(e) {
			      const  value  = e.detail.value;
			      this.leib = this.items[value];
				  this.report.categoryDetail =value
			},
			async getInfo(id){
				const res = await ReportingApi.getReport(id);
				this.report = res.data
				const v = res.data.categoryDetail
				this.queryParams.value=v.toString()
				if(res.code == '0'){
					this.cxlb()
				}
				
			},
			async getfileName(id){
				const res = await ReportingApi.getReportingPicListByReportingId(id);
				
				this.photographPics = res.data
				console.log(res)
			},
			async cxlb(queryParams){
				const res = await dictData.getDict(this.queryParams);
				const data = res.data.list
				this.leib = data[0].label

			},
		}
	}
</script>

<style>
	.jb{
		margin-top: 4%;
		text-align: center;
		font-weight: bold;
	}
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
	.sb {
		top: 100px;
		width: 414px;
		height: 65px;
		top: -4px;
		color: rgba(80, 80, 80, 1);
		background-color: rgba(51, 103, 153, 1);
		font-size: 18px;
		line-height: center;
		text-align: center;
		flex-direction: column;
		/* 设置为列方向布局 */
		align-items: center;
		/* 垂直居中 */
		justify-content: center;
		/* 水平居中（但在这里我们主要关心垂直居中，所以可能需要调整） */
	}
	
	.image_11X1 {
		width: 30px;
		height: 30px;
		left: -40%;
		top: 24px;
	}
	
	.text_148X1 {
		margin-top: -10%;
		width: auto;
		height: 33px;
		left: 51px;
		top: 55px;
		color: rgba(255, 255, 255, 1);
		text-shadow: rgba(0, 0, 0, 0.5) 0px 2px 2px;
		font-size: 18px;
		line-height: 150%;
		text-align: left;
		font-weight: bold;
		padding-right: 80px;
	}
	.zt{
		width: 100%;
	}
	.ts{
		margin-top: 3%;
		margin-left: 56%;
	}
	.person{
		/* text-align: center; */
		width: 100%;
		margin-top: 5%;
		margin-left: 17%;
		font-weight: bold;
		font-size: 14px;
	}
	.bt{
		color: rgba(51, 103, 153, 1);
		font-size: 16px;
	}
	.view-field {
	  width: 90%; /* 或者你需要的宽度 */
	  border: 1px solid #ccc; /* 添加边框 */
	  padding: 1px; /* 添加内边距，使输入框看起来更舒适 */
	  border-radius: 5px;
	  margin-top: 2%;
	  height: 30px;
	  font-size:14px;
	  padding-left: 11px;
	  align-items: center;
	  display: flex;
	}
	.title{
		font-size: 14px;
		color:#888685;
	}
	.border{
		margin-top:2%;
		border-radius: 10px;
		width: 90%;
		background-color: white;
	}
	.button1 {
		width:auto;
		height: 35px;
		/* padding: 10px 10px; */
		margin-top: 8%;
		margin-bottom: 5%;
		border: none;
		border-radius: 5px;
		background-color:#0082df;
		color: white;
		font-size: 16px;
		cursor: pointer;
	}
	.sc{
			margin-top: 5%;
			justify-content: center; 
			align-items: center;
			display: flex;
		    background-color: #0082df;
		    width: 80px;
		    font-size: 11px;
		    color: white;
		    margin-left: 1%;
			height: 25px;
			text-align: center;
	}
	.footer{
		width: 90%;
	}
	.text1{
		margin-top: 3%;
		width: 90%;
		color: #0082df;
		margin-bottom: 5%;
	}
	.zywt{
		width: 90%;
		border: 1px solid #ccc; /* 添加边框 */
		padding: 1px; /* 添加内边距，使输入框看起来更舒适 */
		border-radius: 5px;
		margin-top: 2%;
		font-size:14px;
		padding-left: 11px;
	}
	.picker{
		margin-top:2%;
		align-items: center;
		display: flex;
	}
	.item{
		margin-top: 2%;
		max-width: 300px; /* 设置一个最大宽度 */  
		word-wrap: break-word; /* 允许换行 */  
		white-space: normal;  /* 允许文本换行 */  
		overflow: hidden; /* 在必要时隐藏溢出内容 */  
		text-overflow: ellipsis; /* 在内容超出容器时显示省略号（但这通常与换行一起使用时效果不明显） */ 
	}
</style>
